All Questions
10 questions
1vote
0answers
119views
Recursive macro in Rust to assemble a node tree
This is my first time writing a somewhat non-trivial declarative + recursive macro in Rust. I drew inspiration from this answer. The goal is to come up with a recursive macro that allows to assemble ...
4votes
1answer
447views
tail recursive directory traversal in Rust
Please evaluate and help me understand if my attempted implementation of a tail recursive directory traversal function is actually tail recursive or not. I wrote this from my understanding that a tail ...
2votes
1answer
238views
Finding possible combinations for n<7 with rust
I am trying to learn rust and as such have been redoing some of the challenges on project Rosalind. This one relates to the challenge Enumerating Gene Orders. ...
5votes
1answer
248views
Simple expression evaluator in Rust
What follows is an evaluator for a toy expression language. The language includes functions of a single variable (with lexical binding), along with numbers and a way to apply functions to expressions. ...
2votes
1answer
202views
0votes
1answer
2kviews
Factorial number in Rust for learning purposes
I'm currently trying to learn the basics of the Rust programming language, to do this my first piece of code after the classic 'Hello World' was a simple recursive Factorial function. This is the ...
12votes
2answers
4kviews
Recursive Fibonacci in Rust with memoization
I'm trying to come up with an "elegant" way of calculating Fibonacci for number in Rust, using recursion and memoization (self-imposed requirements). This is what I have so far: ...
2votes
1answer
340views
Ackermann function in Rust
Using the algorithm at the end of this research paper, I've written an extremely fast 1 Ackermann function in Rust. Can the implementation be made faster? Thoughts: Using a struct makes a lot of ...
3votes
1answer
361views
Rust recursion pattern in simple cat program
I'm trying to get my head around recursion in Rust. I've put together a basic implementation of cat here to play with the basics. Here's my recursive version: <...
2votes
1answer
408views
Basic JSON Representation in Rust
This week I started reading "The Rust Programming Language". As I reached the chapters on enumerations and pattern matching I felt I had enough material to put together a simple representation of JSON ...